<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    User
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: _browseUsers.tpl 9739 2012-06-15 02:38:50Z richard $
 * @author     John
 */
?>
<?php
 //Don't render this if not authorized
   $viewer = Engine_Api::_()->user()->getViewer();
   $table = Engine_Api::_()->getItemTable('user');
   $users = $table->fetchAll($select);
     

  //$subject=Engine_Api::_()->core()->getSubject();
?>
<h3>
  <?php echo $this->translate(array('%s member found.', '%s members found.', $this->totalUsers),$this->locale()->toNumber($this->totalUsers)) ?>
</h3>
<?php $viewer = Engine_Api::_()->user()->getViewer();?>
<ul id="browsemembers_ul">
  <?php foreach( $this->users as $user ): ?>
    <li>
      <?php echo $this->htmlLink($user->getHref(), $this->itemPhoto($user, 'thumb.icon')) ?>
      <?php 
      $table = Engine_Api::_()->getDbtable('block', 'user');
      $select = $table->select()
        ->where('user_id = ?', $user->getIdentity())
        ->where('blocked_user_id = ?', $viewer->getIdentity())
        ->limit(1);
      $row = $table->fetchRow($select);
      // echo "<pre>";
      //   print_r($row);
      ?>
      <?php if( $row == NULL ): ?>
        <?php if( $this->viewer()->getIdentity() ): ?>
        <div class='browsemembers_results_links'>
          <?php echo $this->userFriendship($user) ?>
        </div>
      <?php endif; ?>
      <?php endif; ?>

        <div class='browsemembers_results_info'>
          <?php echo $this->htmlLink($user->getHref(), $user->getTitle(), array(id=>'trigger'))  ?>
          <?php echo $user->status; ?>
          <div id="pop-up">
     <?php //echo render('_test.tpl',') ; ?>
   </div> 
 <?php if( $user->status != "" ): ?>            
          
            <div>
              <?php echo $this->timestamp($user->status_date) ?>
            </div>
          <?php endif; ?>
        </div>
    </li>
  <?php endforeach; ?>
</ul>

<?php if($this->users ): ?>
  <div class='browsemembers_viewmore' id="browsemembers_viewmore">
    <?php echo $this->paginationControl($this->users, null, null, array(
      'pageAsQuery' => true,
      'query' => $this->formValues,
      //'params' => $this->formValues,
    )); ?>
  </div>
<?php endif; ?>

<script type="text/javascript">
  page = '<?php echo sprintf('%d', $this->page) ?>';
  totalUsers = '<?php echo sprintf('%d', $this->totalUsers) ?>';
  userCount = '<?php echo sprintf('%d', $this->userCount) ?>';
</script>

<style>
.broker_thumb_normal {
}

.broker_thumb_normal img {
max-width: 105px;
min-height: auto;
}

#addfriend a {
font-size: 12px !important;
font-weight: 400 !important;
}
.userTitleHtmlLink1{
    font-size:12px;
}
.aboutMeContainerDiv1 {
    border-bottom: 1px solid #DDDDDD !important;
    padding: 0 !important;
}
     
      h1, h3 {
        margin: 0;
        padding: 0;
        font-weight: normal;
      }
      
      a {
        color: #EB067B;
      }
      
      div#container{
        width: 80px;
              }
      
      /* HOVER STYLES */
      div#pop-up {
        display: none;
        position: absolute;
        width: 346px;
        padding: 10px;
        color: #000000;
       font-size: 90%;
        height:284px;
      }
      .credibility{
          float:left;
          padding-left:20px;
      }
     
</style> 
    <?php 
   
  //  echo "this is user id=".$user->getIdentity();
//echo "this is viewer id=". $this->viewer()->getIdentity();
    ?>    
    
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script src="showHide.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(){


   $('.show_hide').showHide({			 
		speed: 1000,  // speed you want the toggle to happen	
		easing: '',  // the animation effect you want. Remove this line if you dont want an effect and if you haven't included jQuery UI
		changeText: 1, // if you dont want the button text to change, set this to 0
		showText: 'View',// the button text to show when a div is closed
		hideText: 'Close' // the button text to show when a div is open
					 
	}); 


});

</script>


 <a href="members" class="show_hide" rel="#slidingDiv">View</a><br />
    <div id="slidingDiv">
        Fill this space with really interesting content.
    </div>
    
    
    
 <a href="members" class="show_hide" rel="#slidingDiv_2">View</a><br />
    <div id="slidingDiv_2">
        Fill this space with really interesting content.
    </div> 
   <script type="text/javascript">
   (function ($) {
    $.fn.showHide = function (options) {

		//default vars for the plugin
        var defaults = {
            speed: 1000,
			easing: '',
			changeText: 0,
			showText: 'Show',
			hideText: 'Hide'
			
        };
        var options = $.extend(defaults, options);

        $(this).click(function () {	
           
             $('.toggleDiv').slideUp(options.speed, options.easing);	
			 // this var stores which button you've clicked
             var toggleClick = $(this);
		     // this reads the rel attribute of the button to determine which div id to toggle
		     var toggleDiv = $(this).attr('rel');
		     // here we toggle show/hide the correct div at the right speed and using which easing effect
		     $(toggleDiv).slideToggle(options.speed, options.easing, function() {
		     // this only fires once the animation is completed
			 if(options.changeText==1){
		     $(toggleDiv).is(":visible") ? toggleClick.text(options.hideText) : toggleClick.text(options.showText);
			 }
              });
		   
		  return false;
		   	   
        });

    };
})(jQuery);
   </script>
   <style>

body{
font-family:Verdana, Geneva, sans-serif;
font-size:14px;}

#slidingDiv, #slidingDiv_2{
	height:300px;
	background-color: #99CCFF;
	padding:20px;
	margin-top:10px;
	border-bottom:5px solid #3399FF;
	display:none;
}



</style>
<html>
<head>
 <script type='text/javascript' src="http://code.jquery.com/jquery-latest.min.js"></script>
 <script type='text/javascript'>
 $(function() {
  $('.trigger').click(function() {
   if( $("#toggle").is(":hidden") ) {
    $("#toggle").show();
    return false;
   }
   else
   {
    $("#toggle").hide();
    return false;
   }
   });
  });
  
 </script>
</head>
<body>
<a href="members" class="trigger">Link</a>
<div id="toggle" style="display:none;">
 Show the text in this paragraph
</div>
</body>


